package com.android1.amarena2d.test;

import com.android1.amarena2d.actions.movement.MoveBy;
import com.android1.amarena2d.engine.AmarenaCamera;
import com.android1.amarena2d.input.InverseScrollController;
import com.android1.amarena2d.nodes.Scene;
import com.android1.amarena2d.nodes.SimpleLabel;
import com.android1.amarena2d.nodes.layer.StaticBackground;
import com.android1.amarena2d.nodes.sprites.SharedSprite;
import com.android1.amarena2d.texture.ManagedTexture;
import com.android1.amarena2d.texture.RepeatingTexturedMesh;
import com.android1.amarena2d.texture.TextureOptions;
import com.badlogic.gdx.graphics.Color;

public class CameraActionsScene extends Scene {

    AmarenaCamera camera;

    public CameraActionsScene() {

        camera = engine.getCamera();
        engine.getRenderer().setClearColor(Color.WHITE);

        ManagedTexture texture = engine.getTextureManager().getTexture("assets/toad.png", TextureOptions.REPEATING);

        RepeatingTexturedMesh mesh = new RepeatingTexturedMesh(texture);
        mesh.setRepeatXValue(5);
        mesh.setRepeatYValue(2);
        StaticBackground b = new StaticBackground(mesh);
        add(b);

        final SharedSprite mapSprite = new SharedSprite("assets/map.png", 240, 220);


        final SharedSprite cloud1 = new SharedSprite("assets/cloud1.png", 250, 250);
        final SharedSprite cloud2 = new SharedSprite("assets/cloud2.png", 350, 230);

        add(mapSprite, cloud1, cloud2);

        touch().makeTouchable(new InverseScrollController(engine.getCamera())).setTranslateToScreen();

        add(new SimpleLabel("(Drag the Screen.)", 100, 20, Color.BLACK));

    }

    private void moveCam() {

    }


    @Override
    protected void onEnterFinished() {
        MoveBy move = MoveBy.$(300, 300, 3F);
        MoveBy move2 = move.reverse();


//        engine.getActionManager().run(engine.getCamera(), RepeatForever.$(Sequence.$(move,move2)));

    }
}